Xbasic SQL Actions Code Generator

Description

Generate Xbasic to perform CRUD operations, including nested SQL Queries, against a data source.

Discussion

The Xbasic SQL Actions Code Generator can be used to generate Xbasic to perform create, read, update and delete (CRUD) operations against a data source. The Xbasic SQL Actions Code Generate is especially useful when writing server-side logic in web applications where data needs to be in a JSON format.

The genie uses AlphaDAO connection strings to connect to the data source.

To access the genie, right-click on white space while editing any Xbasic code.

images/xbasicsqlgenie1.png

The Xbasic SQL Genie screen is shown where you can select the type of SQL action you want to perform.

images/xbasicsqlgenie2.jpg

The actions available include:

  • Query a SQL database to get JSON data - generates the Xbasic to perform a query against the database and returns the results in a JSON data format.
  • Query a SQL database to get hierarchical JSON data - generates the Xbasic to perform a query against multiple tables in a database, returning the data in a hierarchical JSON data structure.
  • Perform an UPDATE action - generates the Xbasic to modify one or more fields in a table.
  • Perform an INSERT action - generates the Xbasic to add a new record to a table.
  • Perform a DELETE action - generates the Xbasic to delete a record from a table.

The screen below shows the genie for an UPDATE action. The bottom half of the window shows the generated code based on the settings made in the top part of the screen.

images/xbasicsqlgenie3.jpg